﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_HeThong_NguoiDung : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) {
            LoadData();
        }
    }

    public void LoadData()
    {
        string email = stxtEmail.Text;
        string hoten = stxtHoTen.Text;
        string dienthoai = stxtDienThoai.Text;

        DataGrid.DataSource = QuanLyDAL.listAll();
        DataGrid.DataBind();
    }

    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        LoadData();
    }
    protected void DataGrid_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            QuanLyINFO obj = (QuanLyINFO)e.Row.DataItem;
            string trangthai = "<span class='label label-success'>Hoạt động</span>";
            if (obj.TrangThai == 0)
            {
                trangthai = "<span class='label label-warning'>Khóa</span>";
            }
            else if (obj.TrangThai == 1)
            {
                trangthai = "<span class='label label-danger'>Hoạt động</span>";
            }
            Literal lbltrangthai = (Literal)e.Row.FindControl("ltrTrangThai");
            lbltrangthai.Text = trangthai;
        }
    }
}